#ifndef HTTPDOWDLOADDIALOG_H
#define HTTPDOWDLOADDIALOG_H
#include <QDialog>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QProgressDialog>
#include <QUrl>
#include <QFile>

namespace Ui {
class HttpDowdloadDialog;
}

class HttpDowdloadDialog : public QDialog
{
    Q_OBJECT

public:
    explicit HttpDowdloadDialog(QWidget *parent = 0);
    ~HttpDowdloadDialog();
    void startRequest(QUrl url);

public slots:
    void httpReadyRead();
    void httpDownloadFinished();
    void httpUpdateDownlaodProgress(qint64, qint64);
private slots:
    void enableDownloadButton();
    void cancleDownload();
    void on_quitButton_clicked();
    void on_dowloadButton_clicked();

    void on_lineEdit_returnPressed();

private:
    Ui::HttpDowdloadDialog *ui;
    QNetworkAccessManager* manager;
    QNetworkReply* reply;
    QProgressDialog* progressDialog;
    QUrl url;
    QFile* file;
    bool httpRequestAbort;
};

#endif // HTTPDOWDLOADDIALOG_H
